package com.atlin.project.service;


import com.atlin.project.model.domain.cds.ClientCode;
import com.atlin.project.model.domain.cds.ClientFile;
import com.atlin.project.model.dto.clientFile.ClientFileQueryRequest;
import com.atlin.project.model.vo.cds.ClientFileVO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author atlin
 * @description clientFile
 * @createDate date
 */
public interface ClientFileService extends IService<ClientFile> {

    void valid(ClientFile clientFile, boolean add);

    /**
     * 获取封装
     *
     * @param clientFile
     * @param request
     * @return
     */
    ClientFileVO getClientFileVO(ClientFile clientFile, HttpServletRequest request);


    /**
     * 获取查询条件
     *
     * @param questionQueryRequest
     * @return
     */
    QueryWrapper<ClientFile> getQueryWrapper(ClientFileQueryRequest questionQueryRequest);

    /**
     * 分页获取封装
     *
     * @param questionPage
     * @param request
     * @return
     */
    Page<ClientFileVO> getClientFileVOPage(Page<ClientFile> questionPage, HttpServletRequest request);


    /**
     * 文件上传
     *
     * @param multipartFile 文件
     * @param clientCode    客户端标识
     */
    void uploadFile(MultipartFile multipartFile, ClientCode clientCode);


    /**
     * 文件下载
     *
     * @param clientFile 客户端文件
     * @param response   响应
     */
    void downloadFile(ClientFile clientFile, HttpServletResponse response);
}
